package com.hsyt.pms.api.dto.org;

import com.alibaba.fastjson.JSON;
import com.hsyt.pms.api.constants.PageConstants;
import com.hsyt.pms.api.entity.org.Org;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * @Description: TODO
 * @author wangze@hsyuntai.com
 * @date 2019年2月12日 下午2:45:51
 */
public class OrgDto extends Org {

    private static final long serialVersionUID = 2377539700627474362L;

    private Integer           pageNo;
    private Integer           pageSize;
    private String            provinceValue;
    private String            cityValue;
    private String            countyValue;
    private String            pId;
    private boolean           isParent;
    private String            level;
    private Long              roleId;
    private Integer pageNumber;//第几页
    private Long offset = 0L;
    private String order;
    private String sort;

    public Integer getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(Integer pageNumber) {
        this.pageNumber = pageNumber;
    }

    public Long getOffset() {
        return offset;
    }

    public void setOffset(Long offset) {
        this.offset = offset;
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public Integer getPageNo() {
        if (pageNo == null) {
            pageNo = PageConstants.PAGE_NO;
        }
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Integer getPageSize() {
        if (pageSize == null) {
            pageSize = PageConstants.PAGE_SIZE;
        }
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public String getProvinceValue() {
        return provinceValue;
    }

    public void setProvinceValue(String provinceValue) {
        this.provinceValue = provinceValue;
    }

    public String getCityValue() {
        return cityValue;
    }

    public void setCityValue(String cityValue) {
        this.cityValue = cityValue;
    }

    public String getCountyValue() {
        return countyValue;
    }

    public void setCountyValue(String countyValue) {
        this.countyValue = countyValue;
    }

    public String getpId() {
        return pId;
    }

    public void setpId(String pId) {
        this.pId = pId;
    }

    public boolean isParent() {
        return isParent;
    }

    public void setParent(boolean parent) {
        isParent = parent;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public static void main(String[] args) {
        List<HashMap<String, Object>> list = new ArrayList<HashMap<String, Object>>();
        for (int i = 0; i < 5; i++) {
            HashMap<String, Object> hm = new HashMap<String, Object>(); //最外层，父节点
            hm.put("id", 1);//id属性  ，数据传递
            hm.put("name", 2); //name属性，显示节点名称
            hm.put("pId", 3);
            list.add(hm);
        }
        System.out.println(JSON.toJSONString(list));
        System.out.println(
                "[{\"name\":2,\"pId\":3,\"id\":1},{\"name\":2,\"pId\":3,\"id\":1},{\"name\":2,\"pId\":3,\"id\":1},{\"name\":2,\"pId\":3,\"id\":1},{\"name\":2,\"pId\":3,\"id\":1}]");
    }
}
